﻿#include <QString>
#include <QtTest>
#include "comparenumber.h"

class Homework_oneTest : public QObject
{
    Q_OBJECT

public:
    Homework_oneTest();

private Q_SLOTS:
    void initTestCase();
    void cleanupTestCase();
    void ShouldReturnxAxB();
};

Homework_oneTest::Homework_oneTest()
{

}

void Homework_oneTest::initTestCase()
{
}

void Homework_oneTest::cleanupTestCase()
{
}

void Homework_oneTest::ShouldReturnxAxB()
{
    CompareNumber comparenumber;
    QString result1 = comparenumber.Should_return_xAxB_Given_two_four_digits_that_no_repeat("1234", "1234");
    QVERIFY(result1 == "4A0B");

    QString result2 = comparenumber.Should_return_xAxB_Given_two_four_digits_that_no_repeat("1234", "4321");
    QVERIFY(result2 == "0A4B");

    QString result3 = comparenumber.Should_return_xAxB_Given_two_four_digits_that_no_repeat("1234", "5678");
    QVERIFY(result3 == "0A4B");

    QString result4 = comparenumber.Should_return_xAxB_Given_two_four_digits_that_no_repeat("1234", "1243");
    QVERIFY(result4 == "2A2B");
}

QTEST_APPLESS_MAIN(Homework_oneTest)

#include "tst_homework_onetest.moc"
